<template>
    <div>C组件</div>
    <div>
        <slot name="content" :params="params"></slot>
    </div>
    <div>{{ name }}</div>
    <el-button type="primary" @click="change">注入方直接改变(不可取)</el-button>
    <div>{{ location }}</div>
    <el-button type="primary" @click="updateLocation">在注入方通过供给方改变</el-button>
    
</template>
<script setup lang='ts'>
    import {inject, ref} from 'vue'
    const params = ref({
        name: 'mimo',
        target: '50'
    })
    let name = ref(inject('name'))
    const change = ()=>{
        name.value = 'thc'
    }
    const {location, updateLocation} = inject('location')
</script>
<style lang='scss' scoped>
</style>